<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      div {
        height: 300px;
        border: solid;
        margin: 20px;
        font-size: 3rem;
        display: flex;
        justify-content: center;
        align-items: center;
      }
    </style>
  </head>
  <body style="background-color: yellow">
    <div>div1</div>
    <div>div2</div>
    <div>div3</div>
    <div>div4</div>
    <div>div5</div>
    <div>div6</div>
    <div>div7</div>
    <div style="width: 1000px">div8</div>
    <script>
      setTimeout(() => {
        // window.scrollTo(100, 100);
        window.scrollTo({
          top: 400,
          left: 400,
          behavior: "smooth",
        });
      }, 3000);

      setTimeout(() => {
        // window.scrollTo(100, 100);
        window.scrollTo({
          top: 0,
          left: 0,
          behavior: "smooth",
        });
      }, 5000);
    </script>
  </body>
</html>
